import request from '../utils/request'

/** 登录接口 */
export const login = data => { return request({ url: '/admin/login', data: data, method: 'post' }) }
/** 刷新后台登录token */
export const refreshToken = data => { return request.get('/admin/refreshToken', { params: data }) }
/** 获取用户详情 */
export const getAdmin = data => { return request.get('/admin/getAdmin', { params: data }) }
// 查询所有的城市信息
export const queryAllCityList = data => { return request.get('/basic/queryAllCityList', { params: data }) }
/** 上传文件 */
export const uploadImage = data => { return request.post('/basic/uploadImage', data, { headers: { 'Content-Type': 'multipart/form-data' } }) }
export const uploadFile = data => { return request.post('/basic/uploadFile', data, { headers: { 'Content-Type': 'multipart/form-data' } }) }
// 查询菜单树
export const queryMenuTree = data => { return request.post('/admin/queryMenuTree', data) }
export const createOrUpdateMenu = data => { return request.post('/admin/createOrUpdateMenu', data) }
// 分页查询角色
export const pageQueryRoleList = data => { return request.post('/admin/pageQueryRoleList', data) }
// 编辑角色
export const createOrUpdateRole = data => { return request.post('/admin/createOrUpdateRole', data) }
// 获取角色权限
export const getRole = data => { return request.get('/admin/getRole', { params: data }) }
// 关联角色权限
export const relateRoleMenus = data => { return request.post('/admin/relateRoleMenus', data) }
// 分页查询后台用户
export const pageQueryAdminList = data => { return request.post('/admin/pageQueryAdminList', data) }
// 编辑用户
export const createOrUpdateAdmin = data => { return request.post('/admin/createOrUpdateAdmin', data) }
// 用户关联角色
export const relateAdminRoles = data => { return request.post('/admin/relateAdminRoles', data) }

// 获取教学点
export const getTeachingLocation = data => { return request.get('/admin/getTeachingLocation', { params: data }) }
// 分页查询教学点
export const pageQueryAdminLocationList = data => { return request.post('/admin/pageQueryTeachingLocationList', data) }
export const createOrUpdateTeachingLocation = data => { return request.post('/admin/createOrUpdateTeachingLocation', data) }

// 查询教材列表

export const pageQueryTextbookList = data => { return request.post('/admin/basic/textbook/pageQueryTextbookList', data) }
// 查询知识点列表
export const queryKnowledgeTree = data => { return request.get('/admin/basic/knowledge/queryKnowledgeTree', { params: data }) }

export const createOrUpdateKnowledge = data => { return request.post('/admin/basic/knowledge/createOrUpdateKnowledge', data) }

// 查询章节列表
export const queryChapterTree = data => { return request.get('/admin/basic/chapter/queryChapterTree', { params: data }) }
// 章节编辑
export const createOrUpdateChapter = data => { return request.post('/admin/basic/knowledge/createOrUpdateChapter', data) }

// 查询学科教材
export const querySubjectTextbookList = data => { return request.get('/admin/basic/querySubjectTextbookList', { params: data }) }
export const createOrUpdateTextbook = data => { return request.post('/admin/basic/createOrUpdateTextbook', data) }

/** 年级管理 */
// 列表
export const pageQueryGradeList = data => { return request.post('/admin/basic/grade/pageQueryGradeList', data) }
// 编辑
export const createOrUpdateGrade = data => { return request.post('/admin/basic/grade/createOrUpdateGrade', data) }
/** 学科管理 */
export const pageQuerySubjectList = data => { return request.post('/admin/basic/subject/pageQuerySubjectList', data) }
// 编辑
export const createOrUpdateSubject = data => { return request.post('/admin/basic/subject/createOrUpdateSubject', data) }

/** 后台作业、错题、测评相关 */
// 后台编辑错题
export const adminEditWrongQuestion = data => { return request.post('/admin/adminEditWrongQuestion', data) }
export const createAndRelateQuestion = data => { return request.post('/admin/wrongQuestion/createAndRelateQuestion', data) }
// 错题详情
export const getWrongQuestionDetail = data => { return request.get('/admin/wrongQuestion/getWrongQuestionDetail', { params: data }) }
// 错题初审
export const firstApprove = data => { return request.post('/admin/wrongQuestion/firstApprove', data) }
// 错题终审
export const secondApprove = data => { return request.post('/admin/wrongQuestion/secondApprove', data) }
export const relateQuestion = data => { return request.post('/admin/wrongQuestion/relateQuestion', data) }

export const queryTodoEditWrongImageList = data => { return request.post('/admin/wrongQuestion/queryTodoEditWrongImageList', data) }

// 查询作业or测评列表
export const queryHomeworkList = data => { return request.post('/admin/queryHomeworkList', data) }
// 查询单次作业题列表
export const queryHomeworkQuestionList = data => { return request.get('/admin/queryHomeworkQuestionList', { params: data }) }
// 查询错题列表
export const queryWrongQuestionList = data => { return request.post('/admin/wrongQuestion/queryWrongQuestionList', data) }

/** 后台题库管理 */
// 编辑题目
export const createOrUpdateQuestion = data => { return request.post('/admin/question/createOrUpdateQuestion', data) }
// 查询题库列表
export const pageQueryQuestionList = data => { return request.post('/admin/question/pageQueryQuestionList', data) }
// 删除题目
export const deleteQuestion = data => { return request.post('/admin/question/deleteQuestion', data) }

// 查询教学点列表
export const pageQueryTeachingLocationList = data => { return request.post('/admin/question/pageQueryTeachingLocationList', data) }
// 查询题目难度
export const queryQuestionLevelList = data => { return request.get('/admin/question/queryQuestionLevelList', { params: data }) }
// 查询题型列表
export const queryQuestionTypeList = data => { return request.get('/admin/question/queryQuestionTypeList', { params: data }) }

export const getQuestionConfig = data => { return request.get('/basic/queryWrongReasonList', { params: data }) }
export const getQuestionDetail = data => { return request.get('/admin/question/getQuestion', { params: data }) }

// 查询课件列表
export const queryCourseList = data => { return request.post('/admin/course/queryCourseList', data) }
// 查询课件详情
export const getCourseDetail = data => { return request.get('/admin/course/getCourseDetail', { params: data }) }
// 查询视频课列表
export const queryVideoCourseList = data => { return request.post('/admin/course/queryVideoCourseList', data) }
export const createOrUpdateVideoCourse = data => { return request.post('/admin/course/createOrUpdateVideoCourse', data) }
// 查询视频课详情
export const getVideoCourse = data => { return request.get('/admin/course/getVideoCourse', { params: data }) }
export const getVideoCourseDetail = data => { return request.get('/admin/course/getVideoCourseDetail', { params: data }) }
// 审核教案
export const reviewCourseAudit = data => { return request.post('/admin/course/reviewCourseAudit', data) }
export const reviewCourseFinalAudit = data => { return request.post('/admin/course/reviewCourseFinalAudit', data) }
export const updateCourse = data => { return request.post('/admin/course/updateCourse', data) }

/** 轮播图 */
// 查询广告列表
export const queryAdList = data => { return request.post('/admin/basic/ad/queryAdList', data) }
export const queryAllAddressList = data => { return request.get('/basic/queryAllAddressList') }
// 编辑
export const createOrUpdateAd = data => { return request.post('/admin/basic/ad/createOrUpdateAd', data) }

/** 获取表格数据 */
export const fetchData = data => { return request.post('/student/study/queryWrongQuestionList', data) }

/** 学员管理 */
// 查询学生列表
export const pageQueryStudentList = data => { return request.post('/admin/student/pageQueryStudentList', data) }
// 编辑学生
export const createOrUpdateStudent = data => { return request.post('/admin/student/createOrUpdateStudent', data) }

// 查询监护人表
export const pageQueryParentList = data => { return request.post('/admin/student/pageQueryParentList', data) }
// 获取监护人表
export const getParent = data => { return request.get('/admin/student/getParent', { params: data }) }
// 编辑监护人表
export const createOrUpdateParent = data => { return request.post('/admin/student/createOrUpdateParent', data) }

// 学生成绩表
export const getStudentScore = data => { return request.get('/admin/student/getStudentScore', { params: data }) }
// 查询学生成绩表
export const pageQueryStudentScoreList = data => { return request.post('/admin/student/pageQueryStudentScoreList', data) }
// 编辑学生成绩表
export const createOrUpdateStudentScore = data => { return request.post('/admin/student/createOrUpdateStudentScore', data) }

// 查询学生档案详情
export const getStudentProfile = data => { return request.get('/admin/student/getStudentProfile', { params: data }) }

// 编辑学生档案表
export const createOrUpdateStudentProfile = data => { return request.post('/admin/student/createOrUpdateStudentProfile', data) }

// 分页查询学科成绩等级
export const pageQuerySubjectScoreLevelList = data => { return request.post('/admin/student/pageQuerySubjectScoreLevelList', data) }
// 获取学科成绩等级
export const getSubjectScoreLevel = data => { return request.get('/admin/student/getSubjectScoreLevel', { params: data }) }
// 编辑学科成绩等级
export const createOrUpdateSubjectScoreLevel = data => { return request.post('/admin/student/createOrUpdateSubjectScoreLevel', data) }

// 分页查询学生报名管理
export const pageQueryTeacherStudentList = data => { return request.post('/admin/student/pageQueryTeacherStudentList', data) }
// 获取学生报名管理
export const getTeacherStudent = data => { return request.get('/admin/student/getTeacherStudent', { params: data }) }
// 编辑学生报名管理
export const createOrUpdateTeacherStudent = data => { return request.post('/admin/student/createOrUpdateTeacherStudent', data) }

// 查询电话回访列表
export const pageQueryCallVisitList = data => { return request.post('/admin/student/pageQueryCallVisitList', data) }
// 编辑电话回访
export const createOrUpdateCallVisit = data => { return request.post('/admin/student/createOrUpdateCallVisit', data) }

/** 后台教师相关 */
// 查询教师账户列表
export const pageQueryTeacherAccountList = data => { return request.post('/admin/teacher/pageQueryTeacherAccountList', data) }
// 分页查询教师账户提现
export const pageQueryTeacherAccountWithdrawList = data => { return request.post('/admin/teacher/pageQueryTeacherAccountWithdrawList', data) }
// 提现审核
export const approveAccountWithdraw = data => { return request.post('/admin/teacher/approveAccountWithdraw', data) }
// 获取教师账户提现
export const getTeacherAccountWithdraw = data => { return request.get('/admin/teacher/getTeacherAccountWithdraw', { params: data }) }
// 查询教师投诉表
export const pageQueryTeacherComplaintList = data => { return request.post('/admin/teacher/pageQueryTeacherComplaintList', data) }
// 获取教师角色列表
export const pageQueryTeacherList = data => { return request.post('/admin/teacher/pageQueryTeacherList', data) }
// 获取教师档案列表
export const pageQueryTeacherProfileList = data => { return request.post('/admin/teacher/pageQueryTeacherProfileList', data) }
// 分页查询教师技能考核试卷
export const pageQueryTeacherSkillExamList = data => { return request.post('/teacherSkillExam/pageQueryTeacherSkillExamList', data) }
// 获取教师技能考核试卷
export const getTeacherSkillExam = data => { return request.get('/teacherSkillExam/getTeacherSkillExam', { params: data }) }
// 删除教师技能考核试卷
export const deleteTeacherSkillExam = data => { return request.post('/teacherSkillExam/deleteTeacherSkillExam?' + data) }

// 编辑教师技能考核试卷
export const createOrUpdateTeacherSkillExam = data => { return request.post('/teacherSkillExam/createOrUpdateTeacherSkillExam', data) }

// 获取教师详情
export const getTeacherProfile = data => { return request.get('/admin/teacher/getTeacherProfile', { params: data }) }
export const deleteTeacher = data => { return request.get('/admin/teacher/delete/' + data) }
export const deletePrfile = data => { return request.get('/admin/teacher/profile/delete/' + data) }

// 编辑教师档案
export const createOrUpdateTeacherProfile = data => { return request.post('/admin/teacher/createOrUpdateTeacherProfile', data) }
export const createOrUpdateTeacher = data => { return request.post('/admin/teacher/createOrUpdateTeacher', data) }

/** 统计 */

// 查询错题统计
export const queryWrongQuestionChartList = data => { return request.get('/admin/count/queryWrongQuestionChartList', { params: data }) }
// 查询作业和测评统计
export const queryHomeworkQuestionChartList = data => { return request.post('/admin/count/queryHomeworkQuestionChartList', data) }

/** 教学计划 */
// 查询教学计划列表
export const queryTeachingPlanList = data => { return request.post('/teacher/plan/queryTeachingPlanList', data) }
// 添加
export const addTeachingPlan = data => { return request.post('/teacher/plan/addTeachingPlan', data) }
// 删除
export const deleteTeachingPlan = data => { return request.post('/teacher/plan/deleteTeachingPlan?' + data) }
// 更新
export const modifyTeachingPlan = data => { return request.post('/teacher/plan/modifyTeachingPlan', data) }
